home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / intrvews / xgrab.lha / xgrab / ui / GC / mips_mach_dep.s < prev    next >
Encoding:
Text File  |  1990-04-25  |  3.1 KB  |  141 lines

  1. # define call_mark(x)     move    $4,x;    jal     tl_mark
  2.  
  3.  # Set up _gc_arrays with labels in the middle
  4.     .data
  5.     .globl  _gc_arrays
  6.     .globl  aobjfreelist
  7.     .globl  objfreelist
  8.     .align  2
  9. _gc_arrays:
  10. aobjfreelist:
  11.     .word   0 : 513
  12. objfreelist:
  13.     .word   0 : 513
  14.  # either hblkmap or hblklist.  Reserve space for HBLK_MAP, which is bigger.
  15.     .word   0 : 8192
  16.  
  17.     .text
  18.  # Mark from machine registers that are saved by C compiler
  19.     .globl  mark_regs
  20.     .ent    mark_regs
  21. mark_regs:
  22.     subu    $sp,4       ## Need to save only return address
  23.     sw      $31,4($sp)
  24.     .mask   0x80000000,0
  25.     .frame  $sp,4,$31
  26.     call_mark($2)
  27.     call_mark($3)
  28.     call_mark($16)
  29.     call_mark($17)
  30.     call_mark($18)
  31.     call_mark($19)
  32.     call_mark($20)
  33.     call_mark($21)
  34.     call_mark($22)
  35.     call_mark($23)
  36.     call_mark($30)
  37.     lw      $31,4($sp)
  38.     addu    $sp,4
  39.     j       $31
  40.     .end    mark_regs
  41.  
  42.     .globl  allocobj
  43.     .ent    allocobj
  44. allocobj:
  45.     subu    $sp,68
  46.     sw      $31,68($sp)
  47.     sw      $25,64($sp)
  48.     sw      $24,60($sp)
  49.     sw      $15,56($sp)
  50.     sw      $14,52($sp)
  51.     sw      $13,48($sp)
  52.     sw      $12,44($sp)
  53.     sw      $11,40($sp)
  54.     sw      $10,36($sp)
  55.     sw      $9,32($sp)
  56.     sw      $8,28($sp)
  57.     sw      $7,24($sp)
  58.     sw      $6,20($sp)
  59.     sw      $5,16($sp)
  60.     sw      $4,12($sp)
  61.     sw      $3,8($sp)
  62.     .set    noat
  63.     sw      $at,4($sp)
  64.     .set    at
  65.     .mask   0x8300fffa,0
  66.     .frame  $sp,68,$31
  67.     jal     _allocobj
  68.     lw      $31,68($sp)
  69.     lw      $25,64($sp)
  70.     lw      $24,60($sp)
  71.     lw      $15,56($sp)
  72.     lw      $14,52($sp)
  73.     lw      $13,48($sp)
  74.     lw      $12,44($sp)
  75.     lw      $11,40($sp)
  76.     lw      $10,36($sp)
  77.     lw      $9,32($sp)
  78.     lw      $8,28($sp)
  79.     lw      $7,24($sp)
  80.     lw      $6,20($sp)
  81.     lw      $5,16($sp)
  82.     lw      $4,12($sp)
  83.     lw      $3,8($sp)
  84.  #  don't restore $2, since it's the return value
  85.     .set    noat
  86.     lw      $at,4($sp)
  87.     .set    at
  88.     addu    $sp,68
  89.     j       $31
  90.     .end    allocobj
  91.  
  92.     .globl  allocaobj
  93.     .ent    allocaobj
  94. allocaobj:
  95.     subu    $sp,68
  96.     sw      $31,68($sp)
  97.     sw      $25,64($sp)
  98.     sw      $24,60($sp)
  99.     sw      $15,56($sp)
  100.     sw      $14,52($sp)
  101.     sw      $13,48($sp)
  102.     sw      $12,44($sp)
  103.     sw      $11,40($sp)
  104.     sw      $10,36($sp)
  105.     sw      $9,32($sp)
  106.     sw      $8,28($sp)
  107.     sw      $7,24($sp)
  108.     sw      $6,20($sp)
  109.     sw      $5,16($sp)
  110.     sw      $4,12($sp)
  111.     sw      $3,8($sp)
  112.     .set    noat
  113.     sw      $at,4($sp)
  114.     .set    at
  115.     .mask   0x8300fffa,0
  116.     .frame  $sp,68,$31
  117.     jal     _allocaobj
  118.     lw      $31,68($sp)
  119.     lw      $25,64($sp)
  120.     lw      $24,60($sp)
  121.     lw      $15,56($sp)
  122.     lw      $14,52($sp)
  123.     lw      $13,48($sp)
  124.     lw      $12,44($sp)
  125.     lw      $11,40($sp)
  126.     lw      $10,36($sp)
  127.     lw      $9,32($sp)
  128.     lw      $8,28($sp)
  129.     lw      $7,24($sp)
  130.     lw      $6,20($sp)
  131.     lw      $5,16($sp)
  132.     lw      $4,12($sp)
  133.     lw      $3,8($sp)
  134.  #  don't restore $2, since it's the return value
  135.     .set    noat
  136.     lw      $at,4($sp)
  137.     .set    at
  138.     addu    $sp,68
  139.     j       $31
  140.     .end    allocaobj
  141.